package com.imooc.service;

import com.imooc.dataobject.ProductInfo;
import com.imooc.dto.CartDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * Created by Asus on 2018/11/8.
 */
public interface ProductService {

    ProductInfo findOne(String productId);


    /**
     * 查询所有在架的商品列表
     * @return
     */
    List<ProductInfo>  findUpAll();

    //实现分页功能
    Page<ProductInfo> findAll(Pageable pageable);

    ProductInfo save(ProductInfo productInfo);

    //加库存
    void increaseStock(List<CartDTO> cartDTOList);

    //减库存
    void decreaseStock(List<CartDTO> cartDTOList);

}
